From c5b4644292cb85d0ab17961def67b9553169dd25 Mon Sep 17 00:00:00 2001 From: Mohd Tarmizi Date: Tue, 14 Apr 2015 02:34:33 +0800 Subject: [PATCH] Add a test for duplicate build dependency --- tests/test_cargo_compile_custom_build.rs | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/test_cargo_compile_custom_build.rs b/tests/test_cargo_compile_custom_build.rs index ee438e03c..d5fc4057a 100644 --- a/tests/test_cargo_compile_custom_build.rs +++ b/tests/test_cargo_compile_custom_build.rs @@ -1218,3 +1218,37 @@ test!(build_script_with_lto { assert_that(build.cargo_process("build"), execs().with_status(0)); }); + +test!(test_duplicate_deps { + let p = project("foo") + .file("Cargo.toml", r#" + [project] + name = "foo" + version = "0.1.0" + authors = [] + build = "build.rs" + + [dependencies.bar] + path = "bar" + + [build-dependencies.bar] + path = "bar" + "#) + .file("src/main.rs", r#" + extern crate bar; + fn main() { bar::do_nothing() } + "#) + .file("build.rs", r#" + extern crate bar; + fn main() { bar::do_nothing() } + "#) + .file("bar/Cargo.toml", r#" + [project] + name = "bar" + version = "0.1.0" + authors = [] + "#) + .file("bar/src/lib.rs", "pub fn do_nothing() {}"); + + assert_that(p.cargo_process("build"), execs().with_status(0)); +}); -- 2.30.2